<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<body>
<div th:fragment="news">

    <div class="ui secondary pointing menu">
        <a class="item" href="/" th:classappend=" ${category_id} == 0? active">全部</a>
        <a class="item" th:each="category : ${categories}" th:text="${category.categoryName}"
            th:href="'/c/'+${category.id}"
            th:classappend="${category.id} ==${category_id}? active"></a>
    </div>

    <div class="ui raised segment items" th:each="news  : ${newsList}">
        <div class="item">
            <div class="image">
                <img src="http://www.semantic-ui.cn/images/wireframe/image.png"/>
            </div>
            <div class="content">
                <a class="header" th:href="'/news/'+${news.id}" th:text="${news.title}"></a>
                <div class="extra"><p th:text="${#strings.abbreviate(news.article,300)}"></p></div>
                <div class="meta card">
                    <i class="user icon"></i>
                    <span th:text="${news.author}"></span>
                    <i class="like icon"></i>
                    <span th:text="${news.like}"></span>
                    <i class="time icon"></i>
                    <span th:text="${news.createTime}"></span>
                </div>
            </div>
        </div>
    </div>
</div>

</body>

</html>